package truef.service.comment.service;

import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

import edu.zut.cs.software.base.service.GenericGenerator;
import truef.comment.domain.Comment;
import truef.comment.domain.Record;

public class Comment_EntityGenerator  extends GenericGenerator{

	@Autowired
	CommentManager commentManager;
	
	@Autowired
	RecordManager recordManager;
	
	@Test
    public void gen_record(Record re) {
        for (int i = 0; i < 2; i++) {
        	Record r = new Record();
            r.setName("Record_" + i);
            this.recordManager.save(r);
            for (int j = 0; j < 2; j++) {
            	Record record = new Record();
            	record.setName("record_" + i + "_" + j);
            	//record.setParent(r);
                r = this.recordManager.save(record);
                this.gen_record(r);
            }
        }
    }
	
	public void gen_comment(Comment c) {
		for (int i = 0; i < 2; i++) {
            Comment comment = new Comment();
            comment.setName("commentName_" + i);
            this.commentManager.save(comment);
        }
	}
}